package com.example.listener.utils

import android.annotation.SuppressLint
import androidx.recyclerview.widget.DiffUtil

/**
 *
 * @author xct
 * create on: 2022/9/2 11:23
 *
 */

fun <T:Any> XDiffCallback() = object : DiffUtil.ItemCallback<T>() {
    override fun areItemsTheSame(oldItem: T, newItem: T): Boolean {
        return oldItem === newItem
    }

    @SuppressLint("DiffUtilEquals")
    override fun areContentsTheSame(oldItem: T, newItem: T): Boolean {
        return oldItem == newItem
    }
}


